const ACTION_TYPE_MAP = {
    like: 1,
    unlike: 2
}

async function handleLike(data) {
    const {entityId,entityType=1, likeStatus,postId} = data
    const {like, unlike} = ACTION_TYPE_MAP
    await $.post(`/like/`, {
        entityId,
        entityType,
        actionType: likeStatus ? unlike : like,
        postId:postId||entityId
    })
    ;
    location.reload();
}